package com.yuanda.wordhot.web.interceptor;

import java.util.concurrent.Callable;

import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter;

/**
 * 
 * @author YuBai
 * @since 2013-3-21
 * @Description 超时拦截器
 * @version 1.0
 */
public class TimeoutCallableProcessingInterceptor extends
		CallableProcessingInterceptorAdapter {

	@Override
	public <T> Object handleTimeout(NativeWebRequest request, Callable<T> task)
			throws Exception {
		throw new IllegalStateException("[" + task.getClass().getName()
				+ "] timed out");
	}

}
